﻿namespace ManagerClinic.ThuPhi
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using DevExpress.XtraEditors;
    using ManagerClinic.Core.Business;
    using System.Linq;

    public partial class frmDanhSachChoThuPhi : DevExpress.XtraEditors.XtraForm
    {
        ThuPhiDichVuBusiness thuPhiDichVuBusiness = null;

        public frmDanhSachChoThuPhi()
        {
            InitializeComponent();
            thuPhiDichVuBusiness = new ThuPhiDichVuBusiness();

            dtNgayDenKham.EditValue = DateTime.Now;
        }

        void LoadDataGrid()
        {
            var lstDanhSachChoThuPhi = this.thuPhiDichVuBusiness.GetAllDanhSachBenhNhanThuPhi((DateTime)dtNgayDenKham.EditValue, (Int32)radTrangThai.EditValue);
            grdDanhSachChoThuPhi.DataSource = lstDanhSachChoThuPhi;
        }

        private void frmDanhSachChoThuPhi_Load(object sender, EventArgs e)
        {
            LoadDataGrid();
        }

        private void btnLamMoi_Click(object sender, EventArgs e)
        {
            LoadDataGrid();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            LoadDataGrid();
        }
    }
}